package com.xjk.demo.service.impl;

import com.xjk.demo.entity.GoodsParam;
import com.xjk.demo.entity.User;
import com.xjk.demo.mapper.UserMapper;
import com.xjk.demo.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public int getCount(GoodsParam p) {
        return userMapper.getCount(p);
    }

    @Override
    public List<User> getUserList(GoodsParam p) {
        return userMapper.getUserList(p);
    }

    @Override
    public void delAll(@Param("ids") String ids) {
            String[] uid1 = ids.split(",");
            for (String u : uid1){
                Integer uida=Integer.parseInt(u);
                userMapper.delAll(uida);
            }
    }
}
